{	Problem: http://codeforces.ru/problemset/problem/78/A
 	Verdict: Accepted
}
var i,c:longint; s:string; f:boolean; t:set of char;
begin 
readln(s);
t:=['a','e','i','o','u'];
c:=0;
f:=true;
for i:=1 to length(s) do
    if s[i] in t then inc(c);   
if c=5 then begin
    c:=0;
    readln(s);
    for i:=1 to length(S) do 
        if s[i] in t then inc(c);
    if c=7 then begin
        c:=0;
        readln(s);
        for i:=1 to length(s) do 
            if s[i] in t then inc(c);
        if c<>5 then f:=false;
    end else f:=false;
end else f:=false;
if f then write('YES') else write('NO'); 
end.